package com.emagic.manage.modules.loginmodule.domain;

import com.emagic.manage.data.entities.response.UserResponse;
import com.emagic.manage.data.repository.Repository;
import com.emagic.manage.mvp.domain.UseCase;

import javax.inject.Inject;

import rx.Observable;

/**
 * Created by cao-q on 16/8/9.
 */
public class LoginUseCase extends UseCase<UserResponse> {
    private Repository mRepository;
    private String phone;
    private String pwd;
    private String cidentifier;
    private String alias;

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getCidentifier() {
        return cidentifier;
    }

    public void setCidentifier(String cidentifier) {
        this.cidentifier = cidentifier;
    }

    public String getAlias() {
        return alias;
    }

    public void setAlias(String alias) {
        this.alias = alias;
    }

    @Inject
    public LoginUseCase(Repository repository) {
        this.mRepository = repository;
    }

    @Override
    protected Observable<UserResponse> buildObservable() {
        return mRepository.loginapi(phone, pwd, cidentifier, alias);
    }
}
